import request from '@/utils/request'
// 获取权限列表
const getPermissionsListAPI = () => {
  return request({
    url: '/sys/permission'
  })
}
// 新增权限
const addPermissionAPI = data => {
  return request({
    url: '/sys/permission',
    method: 'POST',
    data
  })
}
// 更新权限
const updatePermissionAPI = data => {
  return request({
    url: `/sys/permission/${data.id}`,
    method: 'put',
    data
  })
}
// 删除权限
const delPermissionAPI = id => {
  return request({
    url: `/sys/permission/${id}`,
    method: 'delete'
  })
}

// 获取权限详情
const getPermissionDetailAPI = id => {
  return request({
    url: `/sys/permission/${id}`,
    method: 'GET'
  })
}
export { getPermissionsListAPI, addPermissionAPI, updatePermissionAPI, delPermissionAPI, getPermissionDetailAPI }
